1 00:00:01,930 --> 00:00:02,410 Okay. 2 00:00:02,410 --> 00:00:07,570 I'm going to quickly talk about the client server communication model and what it does in Roblox. 3 00:00:07,960 --> 00:00:11,890 So in multiplayer games, you know, there are a bunch of players who are running the game on their 4 00:00:11,890 --> 00:00:15,700 computers and you have all these players connected together by a server. 5 00:00:16,360 --> 00:00:21,160 The same idea applies with roadblocks as each client runs the graphics and client sited code on their 6 00:00:21,160 --> 00:00:21,970 computers. 7 00:00:21,970 --> 00:00:27,310 Any updates to other players movements or anything happen in the server gets copied and downloaded to 8 00:00:27,310 --> 00:00:28,180 your computer. 9 00:00:28,360 --> 00:00:33,130 Basically, the game is replicating or copying from the server to your computer. 10 00:00:33,160 --> 00:00:37,300 Now what this means is that you can perform things in this copy of the game on your computer that can't 11 00:00:37,300 --> 00:00:39,310 be seen by the server or the players. 12 00:00:39,340 --> 00:00:44,140 The only exception to this is control over your character, which automatically gets replicated from 13 00:00:44,140 --> 00:00:47,530 your computer to the server and back to all the other clients. 14 00:00:50,180 --> 00:00:55,460 So when you join a game and roadblocks, the server copies all the scripts and instances from replicated 15 00:00:55,460 --> 00:01:01,700 storage replicated first the workspace starter player script sounds and gives to your game. 16 00:01:02,150 --> 00:01:08,120 Anything stored in the server storage or server script service does not get copied to your game because 17 00:01:08,120 --> 00:01:11,450 those are server related containers and you don't get access to them. 18 00:01:12,580 --> 00:01:16,630 Now because Roblox runs on the idea that the server replicates stuff to your game. 19 00:01:16,630 --> 00:01:18,550 How do we send information to the server? 20 00:01:18,550 --> 00:01:21,820 Like when I press a button and a door should open for all the other players. 21 00:01:22,210 --> 00:01:24,910 This is where remote events and remote functions come in. 22 00:01:25,180 --> 00:01:30,790 A remote event is an event in your game that you can fire from the client to the server to pass on when 23 00:01:30,790 --> 00:01:32,800 something happens from your copy of the game. 24 00:01:32,830 --> 00:01:38,050 The servers job is to verify any information coming from your computer, your client, and once it's 25 00:01:38,050 --> 00:01:42,400 been verified, then it can replicate those changes to all the other clients in the game. 26 00:01:42,940 --> 00:01:48,220 The server can also send information using remote events to specific client or to all the clients for 27 00:01:48,220 --> 00:01:49,510 a multitude of reasons. 28 00:01:49,930 --> 00:01:55,300 Now, a remote function is when you send information to the server and then you yield the script until 29 00:01:55,300 --> 00:01:57,580 the server sends information back to you. 30 00:01:57,820 --> 00:01:59,500 Why would we want to do this? 31 00:01:59,530 --> 00:02:04,180 Well, there may be cases where you need to enter a password or something and the server has to verify 32 00:02:04,180 --> 00:02:06,880 whether or not the code you entered matches the correct one. 33 00:02:07,060 --> 00:02:11,680 You don't want to store the code on the client because then exploiters can get access to the scripts 34 00:02:11,680 --> 00:02:14,080 and read the password, which you never want. 35 00:02:14,900 --> 00:02:19,340 So basically anything that the server does gets replicated to all the clients. 36 00:02:19,340 --> 00:02:25,190 While anything a client does only gets shown in their copy of the game unless that client fires a remote 37 00:02:25,190 --> 00:02:30,680 to the server, the server verifies the information and replicates it back to all the other clients. 38 00:02:30,890 --> 00:02:34,280 This is the basic idea of client server communication. 39 00:02:34,550 --> 00:02:37,550 I'll leave this article linked in case you'd like to read more about it.